package eo.descriptor.property;

/**
 * Describes a property.
 * 
 * @author takeshi
 * 
 */
public interface PropertyDescriptor {

    /**
     * Gets the name of this property.
     * 
     * @return
     */
    String getName();

    /**
     * Returns wheter or not this property represents the Id of the entity.
     * 
     * @return
     */
    boolean isId();

    /**
     * Returns wheter or not this property represents a collection.
     * 
     * @return
     */
    boolean isMany();

    /**
     * Returns wheter or not this property is an association,
     * 
     * @return
     */
    boolean isAssociation();

    /**
     * Returns wheter or not this property is an embedded instance.
     * 
     * @return
     */
    boolean isEmbedded();
    
    /**
     * Return wheter or not this property is an {@link Enum}.
     * @return
     */
    boolean isEnum();

    /**
     * Given an entity, returns the value that this property represents.
     * 
     * @param entity
     *            the entity
     * @return {@link Object} the value of this property
     */
    Object getValue(final Object entity);

}
